package org.jeecg.modules.relation.relteachersubject.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.relation.relbuildingclassroom.vo.RelBuildingClassroomVo;
import org.jeecg.modules.relation.relteachersubject.entity.RelTeacherSubject;
import org.jeecg.modules.relation.relteachersubject.mapper.RelTeacherSubjectMapper;
import org.jeecg.modules.relation.relteachersubject.service.IRelTeacherSubjectService;
import org.jeecg.modules.relation.relteachersubject.vo.RelTeacherSubjectVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: rel_teacher_subject
 * @author: baochangrong
 * @Date: 2022-02-16
 * @Version: V1.0
 */
@Service
public class RelTeacherSubjectServiceImpl extends ServiceImpl<RelTeacherSubjectMapper, RelTeacherSubject> implements IRelTeacherSubjectService {

    @Autowired
    private RelTeacherSubjectMapper relTeacherSubjectMapper;

    @Override
    public List<RelTeacherSubjectVO> queryAllTeacher(String tenantId) {
        return relTeacherSubjectMapper.queryAllTeacher(tenantId);
    }

    @Override
    public List<RelTeacherSubjectVO> queryAllSubject(String tenantId) {
        return relTeacherSubjectMapper.queryAllSubject(tenantId);
    }

    @Override
    public IPage<RelTeacherSubjectVO> queryVo(Page page, RelTeacherSubject relTeacherSubject) {
        List<RelTeacherSubjectVO> relTeacherSubjectVOList = relTeacherSubjectMapper.queryVo(relTeacherSubject);
        Integer total = relTeacherSubjectVOList.size();
        IPage<RelTeacherSubjectVO> result = new Page<>(page.getCurrent(), page.getSize(), total);
        result.setRecords(relTeacherSubjectVOList);
        return result;
    }

    @Override
    public List<RelTeacherSubjectVO> queryTeacherListBySubject(RelTeacherSubjectVO relTeacherSubjectVO) {
        return relTeacherSubjectMapper.queryTeacherListBySubject(relTeacherSubjectVO);
    }
}
